from typing import Dict, List

from flask import Blueprint, request
from common import helper

demo_api_bp = Blueprint("demo_api", __name__)


@demo_api_bp.route("/saveForm", methods=["POST"])
def save_form():
    data = request.get_json()
    print(data)
    return helper.success(msg="提交成功")


@demo_api_bp.route("/saveUserInfo", methods=["POST"])
def save_user_info():
    data = request.get_json()
    username = data.get("user_name")
    usersex = data.get("user_sex")
    if usersex is None:
        return helper.failure(msg="用户性别不能为空")
    return helper.success(msg="保存用户信息成功")